Skip to main content

Common Node Operations

Updates are easy to be applied through migration scripts. Node operators can access these scripts on the rizenet-node github repository. The instructions on how to execute them are below.

The node version is kept locally as a value on the file rizenet-node/migration.

By default the logs of the migration execution can be found at $HOME/rizenet_node_migrations.log

Moving the data directory of the node​

An example of scenario that would require moving the data directory of the node from one folder path into another is if a node operator add a new disk to a system.

The rizenet-node repository contains a script that can be used to move the data of the node from one folder to another in the same system, with minimal downtime.

The script mvDataDir works simmilar to how the mv command works in Unix, meaning that it takes two parameters: the source path and destination path:

  1. Set the values of the source path and the destination path:
export SOURCE_RIZENET_DATA_DIR="<FILL ME>" # By default, it is "~/rizenetDataDir"
export DESTINATION_RIZENET_DATA_DIR="<FILL ME>"
  1. Run the operation to move the node data directory:
# go to the rizenet-node repository folder
cd rizenet-node

# reset any changes made to tracked files of the rizenet-node tools and get the latest from git:
git reset --hard
git pull

# ask for sudo password only once, if needed:
if sudo -l -n 2>/dev/null | grep -q "NOPASSWD:"; then
echo "Sudo is passwordless; skipping sudo -v." >> "$HOME/rizenet_node_operations.log"
else
echo "Sudo requires a password; running sudo -v." >> "$HOME/rizenet_node_operations.log"
sudo -v
fi

# Clean the log file from the string that marks the end of it:
sed -i 's/OPERATION_FINISHED/OPERATION COMPLETED/g' "$HOME/rizenet_node_operations.log"

(sudo nohup bash ./mvDataDir.sh $SOURCE_RIZENET_DATA_DIR $DESTINATION_RIZENET_DATA_DIR >> $HOME/rizenet_node_operations.log 2>&1 &); \
tail -f $HOME/rizenet_node_operations.log | sed '/OPERATION_FINISHED/ q'

Once finished, you will get an output on screen that you can share with your Rizenet admin contact so they can verify that everything executed correctly and your node is spinning.